package com.example.demo.threadPool;

public class Producer implements Runnable {
    private Vo vo;
    public Producer(Vo vo){
        this.vo = vo;
    }
    @Override
    public void run() {
        for(int i=0; i<10; i++){
            if(i%2==0){
                vo.setName(i + "胡歌");
                try {
                    Thread.sleep(50);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                vo.setRole(i + "将军");
            }else{
                vo.setName(i + "刘涛");
                try {
                    Thread.sleep(50);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                vo.setRole(i + "郡主");
            }
        }
    }
}
